package util;

import java.util.Random;
import java.util.UUID;

public class VerifyCode {
    private static final String codes  = "abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ";
    private static final String number="1234567890";
    public static String getNewVerifyCode(int len){
        if(len==0){
            return "";
        }
        Random r = new Random();
        char[] str=new char[len];
        int index=0;
        if(len>4){
            str[0]=number.charAt(r .nextInt(number.length()));
            str[1]=number.charAt(r.nextInt(number.length()));
            index=2;
        }
        while (index<len){
            str[index]=codes.charAt(r.nextInt(codes.length()));
            index++;
        }
        return new String(str);
    }
}
